<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        html,body{
            width:100%; height:100%;
        }
       body{
           overflow-x: hidden;
           background: transparent;
         }
        iframe{
            width:100%;
            height:100%;
            border:none;
        }
    </style>
</head>
<body>
<script src="../../../assert/js/jquery.js" th:src="@{/assert/js/jquery.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<iframe id="myframe" src=""></iframe>
<a id="basePath" th:href="@{/}"></a>
<script type="text/javascript">
    var basePath = $("#basePath").attr("href");
    $.ajax({
        type: "get",
        url: basePath + "rest/tagManager/getTagAddress",
        data: {},
        success: function (data) {
            if (data.msg != "") {
                var myframe = document.getElementById('myframe');
                myframe.setAttribute("src",data.msg+"/rest/page/tagStatistic")
                window.addEventListener('message',function(e){
                    var username=sessionStorage.getItem("spanId");
                    var seatId=sessionStorage.getItem("seatId");
                    var  index=data.msg.lastIndexOf("/");
                    if(e.data.msg==='loaded'){
                        //传入子页面信息
                        myframe.contentWindow.postMessage({data:{
                                username:username,
                                seatId:seatId
                            }},e.data.url);
                    }
                });
            }
        }
    });
</script>
</body>
</html>